<?php

namespace app\yyq\controller;
use app\admin\model\Userz;
use think\Controller;

class Login extends Controller
{

    public function login()
    {
        $data = $this->request->post();
        $model = new Userz();
        if (!empty($data)){
            $model = $model->where('userid', '=', $data['userid'])->find();
            if ($model['password'] == $data['password']){
                $this->success('登录成功', 'index/index');
            }else{
                $this->error('密码错误');
            }
        }
        return $this->fetch('login', $this->getCommonData());
    }

}